// app/model/comment.js
module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
  
    const CommentSchema = new Schema({
        body: { type: String, required: true },
        userId: { type: Schema.Types.ObjectId, ref: 'User' },
        articleId: { type: Schema.Types.ObjectId, ref: 'Article' },
      }, { timestamps: true });
  
    return mongoose.model('Comment', CommentSchema);
  }
  